package com.project.service.impl.backend.basic;

import java.util.List;

import com.project.dao.IMenuDao;
import com.project.dao.bean.Menu;
import com.project.service.backend.basic.IPreSchoolManageService;
import com.project.service.impl.BaseServiceImpl;

public class PreSchoolManageServiceImpl extends BaseServiceImpl implements
		IPreSchoolManageService {
	private IMenuDao menuDao;

	public void setMenuDao(IMenuDao menuDao) {
		this.menuDao = menuDao;
	}

	@Override
	public List<Menu> getDescendantMenuByAncestorCodeAndSeq(
			String ancestorCode, String seq) throws Exception {
		// TODO Auto-generated method stub
		return menuDao.getDescendantMenuByAncestorCodeAndSeq(ancestorCode, seq);
	}

	@Override
	public void save(String chkedMenuId) throws Exception {
		// TODO Auto-generated method stub
		menuDao.updateIsShowToUnShow();
		String[] menuArr = chkedMenuId.split("[,]");
		for(String s:menuArr) {
			String[] tempArr = s.split("[|]");
			String id = tempArr[0];
			String showSort = tempArr[1];
			menuDao.updateIsShow(id, showSort);
		}
	}

}
